package cn.lucky.springcloud.service;

import cn.lucky.springcloud.client.OpenfeignClient;
import cn.lucky.springcloud.entities.CommonResult;
import cn.lucky.springcloud.entities.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author lingpeng.jiang
 * @create 2020-12-27-15:49
 */
@Service
public class OpenfeignService {


    @Autowired
    private OpenfeignClient openfeignClient;

    public CommonResult<Payment> getPaymentById(Long id){
        return openfeignClient.getPaymentById(id);
    }

    public CommonResult<Payment> queryPayment(){
        return openfeignClient.queryPayment();
    }

    /**
     * 测试openfeign的超时控制
     * @return
     */
    public String testOpenfeignTimeOut(){
        return openfeignClient.testOpenfeignTimeOut();
    }
}
